#include <bits/stdc++.h>
// 2025/03/23
// tag: 
// Author: Forever
using namespace std;
using int64 = int64_t;
#define int long long

int k, n, l;
const int p = 1e9 + 7;

int quick_pow(int x, int n)
{
    int res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * x % p;
        x = x * x % p;
        n >>= 1;
    }
    return res;
}

int C(int m, int n){

    int res = 1;
    for (int i = 1; i <= n; i++)
        res = res * i % p;
    for (int i = 1; i <= n - m; i++)
        res = res * quick_pow(i, p - 2) % p;
    for (int i = 1; i <= m; i++)
        res = res * quick_pow(i, p - 2) % p;
    return res;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> k >> n >> l;
    string s;
    cin >> s;
    int ans = 1, v = 0;
    for (int i = s.size() - 1; i >= 0; i--)
        if (s[i] == 'M')
            ans = (ans * C(k, v)) % p, v -= k;
        else
            v++;
    cout << ans << endl;
    return 0;
}